<?php
namespace app\admin\controller;

use app\common\service\AdminLogin;
use think\Controller;
use think\Request;

/**
 * @name 后台统一控制器
 * @desc 后台统一控制器
 * @auth false
 * @author: xujianping(814876569@qq.com)
 * @datetime: 2017/9/18 上午 10:37
 */
class Common extends Controller
{
    protected $adminLogin;

    public function __construct(Request $request,AdminLogin $adminLogin)
    {
        parent::__construct($request);
        $this->adminLogin = $adminLogin;
        
        if (!$this->adminLogin->checkLogin()){
            $this->redirect($this->adminLogin->adminLoginPage);
        }

        $userInfo = $this->adminLogin->getUserInfo();
        $this->assign('userInfo',$userInfo);
        
    }


}